define(['WebPDF', 
	 'angularMocks', 
	 'app/js/PDFView/PDFDocViewerDirective',
	 'app/js/PDFView/template',
	 './PDFDocDataMock'], function(WebPDF, angularMocks, PDFDocViewerDirect, template, PDFDocData) {
	 	'use strict';
	describe('PDFDocViewerDirective', function() {

		var $httpBackend ;
		beforeEach(module('WebPDF'));

		beforeEach(inject(function($compile, $rootScope, $templateCache, _$httpBackend_) {
			$httpBackend = _$httpBackend_;
			$httpBackend.expectGET('/app/pdfdata/doc-1/PagesInfo_form').respond(PDFDocData);
		}));

		afterEach(function() {
	        $httpBackend.verifyNoOutstandingExpectation();
	        $httpBackend.verifyNoOutstandingRequest();
	    });
		it ('create pdfdocviewer', inject(function($compile, $rootScope, $httpBackend) {
			var $scope = $rootScope.$new();
			var element = $compile('<div pdfdocviewer></div')($scope);
			$httpBackend.flush();			
			$scope.$digest();						
			expect($(element).find("[pdf-doc]").length).toBe(1);
			expect($(element).find("[pdf-page]").length).toBe(4);
		}));
	});
});